<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/sinopac-fn" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>主管覆核確認</title>
	<link rel="stylesheet" href="${fn:url('/form/CSS/tabs.css')}">
	<script type="text/javascript" src="${fn:url('/js/jQuery/jquery-1.8.2.min.js')}"></script>
	<script type="text/javascript" src="${fn:url('/js/jQuery/jquery_DOMWindow.js')}"></script>
	<script type="text/javascript" src="${fn:url('/js/tools/formUtil.js')}"></script>
	<script>
		$(document).ready(function(){
			$('input[name=btnOK]').click(function(){
				var f = $('#form1');
				f.prop('action',"${fn:url('/SupervisorReconfirm/executeTransactions.action')}");
				f.submit();
			});
			$('input[name=btnPrint]').click(function(){
				window.print();
			});
			$('input[name=btnCancel]').click(function(){
				var f = $('#form1');
				f.prop('action',"${fn:url('/SupervisorReconfirm/index.action')}");
				f.submit();
			});
		});
	</script>
</head>
<body>
	<%@ include file="/form/include/title.jsp" %>
	<s:form id="form1">
		<table align="center">
			<tr>
				<td><font size="4">您將覆核以下作業，請確認確定執行。</font></td>
			</tr>	
		</table>
		<s:if test="supvList.taskList.size()>0">
			<table class="table-style" align="center">
				<tr>
					<th style="width: 30px">項次</th>
					<th>客戶ID</th>
					<th>客戶名稱</th>
					<th>TOKEN ESN</th>
					<th>作業</th>
					<th>覆核</th>
					<th>註解</th>
				</tr>
				<s:iterator value="supvList.taskList" status="row" var="job">
				<s:if test="refuse">
					<tr style="color: red">
						<td align="center"><s:property value="#row.index+1"/></td>
						<td><s:property value="customer_id"/></td>
						<td><s:property value="customer_name"/></td>
						<td><s:property value="token_esn"/></td>
						<td><s:property value="job_code_msg"/></td>
						<s:if test="permit">
							<td><s:label value="核准" theme="simple"/></td>
						</s:if>
						<s:else>
							<td><s:label value="拒絕" theme="simple"/></td>
						</s:else>
						<td><s:property value="comment"/></td>
						<td style="display: none;">
							<s:hidden name="supvList.taskList[%{#row.index}].job_id" value="%{#job.job_id}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].customer_id" value="%{#job.customer_id}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].group_id" value="%{#job.group_id}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].token_esn" value="%{#job.token_esn}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].token_status" value="%{#job.token_status}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].job_code" value="%{#job.job_code}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].permit" value="%{#job.permit}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].refuse" value="%{#job.refuse}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].comment" value="%{#job.comment}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].operator" value="%{#job.operator}"/>
						</td>
					</tr>
				</s:if>
				<s:else>
					<tr>
						<td align="center"><s:property value="#row.index+1"/></td>
						<td><s:property value="customer_id"/></td>
						<td><s:property value="customer_name"/></td>
						<td><s:property value="token_esn"/></td>
						<td><s:property value="job_code_msg"/></td>
						<s:if test="permit">
							<td><s:label value="核准" theme="simple"/></td>
						</s:if>
						<s:else>
							<td><s:label value="拒絕" theme="simple"/></td>
						</s:else>
						<td><s:property value="comment"/></td>
						<td style="display: none;">
							<s:hidden name="supvList.taskList[%{#row.index}].job_id" value="%{#job.job_id}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].customer_id" value="%{#job.customer_id}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].group_id" value="%{#job.group_id}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].token_esn" value="%{#job.token_esn}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].token_status" value="%{#job.token_status}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].job_code" value="%{#job.job_code}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].permit" value="%{#job.permit}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].refuse" value="%{#job.refuse}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].comment" value="%{#job.comment}"/>
							<s:hidden name="supvList.taskList[%{#row.index}].operator" value="%{#job.operator}"/>
						</td>
					</tr>
				</s:else>
				</s:iterator>
			</table>
		</s:if>
		<s:if test="supvList.fileList.size()>0">
			<table class="table-style" align="center">
				<tr>
					<th style="width: 30px">項次</th>
					<th>檔案名稱</th>
					<th>筆數</th>
					<th>作業</th>
					<th>覆核</th>
					<th>註解</th>
				</tr>
				<s:iterator value="supvList.fileList" status="row" var="job">
					<tr>
						<td><s:property value="#row.index+1"/></td>
						<td><s:property value="batch_file"/></td>
						<td><s:property value="batch_amount"/></td>
						<td><s:property value="job_code_msg"/></td>
						<s:if test="permit">
							<td><s:label value="核准" theme="simple"/></td>
						</s:if>
						<s:else>
							<td><s:label value="拒絕" theme="simple"/></td>
						</s:else>
						<td><s:property value="comment"/></td>
						<td style="display: none;">
							<s:hidden name="supvList.fileList[%{#row.index}].job_id" value="%{#job.job_id}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].job_code" value="%{#job.job_code}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].batch_file" value="%{#job.batch_file}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].batch_amount" value="%{#job.batch_amount}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].permit" value="%{#job.permit}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].refuse" value="%{#job.refuse}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].comment" value="%{#job.comment}"/>
							<s:hidden name="supvList.fileList[%{#row.index}].operator" value="%{#job.operator}"/>
						</td>
					</tr>
				</s:iterator>
			</table>
		</s:if>
		<s:if test="supvList.fileList.size()>0">
		</s:if>
		<s:if test="supvList.fileList.size()>0 || supvList.taskList.size()>0">
			<table width="700" align="center">
				<tr height="50">
				<tr>
					<td align="center"><input type="button" name="btnOK" value="確定"></td>
					<td align="center"><input type="button" name="btnCancel" value="取消"></td>
					<td align="center"><input type="button" name="btnPrint" value="列印"></td>
				</tr>
			</table>
		</s:if>
	</s:form>
</body>
</html>